package cn.qj.ymcc.controller;


import cn.qj.ymcc.doc.CourseDoc;
import cn.qj.ymcc.result.JSONResult;
import cn.qj.ymcc.service.ESCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/es")
public class ESCourseSaveController {
    @Autowired
    private ESCourseService esCourseService;
    @PostMapping("/save")
    public JSONResult save(@RequestBody List<CourseDoc> courseDocs) {
        esCourseService.save(courseDocs);
        return JSONResult.success();
    }
}
